package com.lds.config.center.server.business.item.converter;

import com.lds.config.center.common.model.item.request.ItemBaseListRequest;
import com.lds.config.center.server.business.item.entity.Item;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;


@Component
public class ItemBaseListRequestToEntityConverter implements Converter<ItemBaseListRequest, Item> {

    @Override
    public Item convert(ItemBaseListRequest source) {
        return Item.builder()
                .id(source.getId())
                .name(source.getName())
                .value(source.getValue())
                .valueType(source.getValueType())
                .createTime(source.getCreateTime())
                .updateTime(source.getUpdateTime())
                .namespaceId(source.getNamespaceId())
                .build();
    }

}


